﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace CJJCH.Web.Manage
{
    public partial class NormDetails : PowerBase
    {
        CJJCH.BLL.T_INF_Norm bll_norm = new CJJCH.BLL.T_INF_Norm();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                InitRequest();
                ShowNorm();
            }
        }

        private void InitRequest()
        {
            if (!string.IsNullOrEmpty(Request.QueryString["ID"].ToString()) && LTP.Common.CheckInput.CheckGUID(Request.QueryString["ID"].ToString()))
            {
                ViewState["ID"] = Request.QueryString["ID"].ToString();
            }
            else
            {
                LTP.Common.WindowClass.WindowBack("操作错误！");
            }
        }

        private void ShowNorm()
        {
            CJJCH.Model.T_INF_Norm model = new CJJCH.Model.T_INF_Norm();
            model = bll_norm.GetNormModel(new Guid(ViewState["ID"].ToString()));
            if (model != null)
            {
                this.lblTitle.Text = model.NormTitle;
                this.lblSource.Text = model.NormSource;
                this.lblNote.Text = model.NormNote;
                this.lblNormType.Text = model.Normtype.TypeName;
                this.lblIsHot.Text = model.IsHot ? "是" : "否";
                this.lblIsTop.Text = model.IsTop ? "是" : "否";
                this.lblHits.Text = model.Hits.ToString();
                this.lblPlusDate.Text = model.PlusDate.ToString("yyyy/MM/dd");
                this.lblOrderNum.Text = model.OrderNum.ToString();
            }
            else
            {
                LTP.Common.WindowClass.WindowBack("操作错误！");
            }
        }
    }
}